package p3;

/**
 * Interface methods
 */

interface Lunchable{
	public int eat();
}

class Sandwich implements Lunchable{
	public int eat() {
		System.out.println("Chomp, excellent! I like sandwiches.");
		return 1;
	}
}

class Rock implements Lunchable{
	public int eat() {
		System.out.println("Chomp, ouch!!");
		return 1;
	}	
}

//class Carrot implements Lunchable{
//}

public class Main3 {
	public static void main(String[] args) {
		Lunchable[] fridge = new Lunchable[10];
		fridge[0] = new Sandwich();
		fridge[1] = new Sandwich();
		fridge[2] = new Rock();
		
		for (Lunchable x : fridge)
			x.eat();
	}
}
